package cn.huihui.miniprogram.stuman.controller;

import cn.huihui.miniprogram.stuman.dto.AttendanceDto;
import cn.huihui.miniprogram.stuman.dto.ExamArrangementDto;
import cn.huihui.miniprogram.stuman.dto.ScoreDto;
import cn.huihui.miniprogram.stuman.service.AllService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 学业相关接口
 */
@Api("学业相关接口")
@RestController
@RequestMapping("/study")
public class StudyController {

    @Autowired
    AllService allService;

    @ApiOperation("根据课程名获取课程成绩")
    @GetMapping("/score")
    public ScoreDto searchScoreOfCourseName(String type){
        return allService.searchScoreOfCourseName(type);
    }

    @ApiOperation("获取考勤信息")
    @GetMapping("/attendance")
    public List<AttendanceDto> getAttendance(){
       return allService.getAttendance();
    }

    @ApiOperation("获取考试时间表")
    @GetMapping("/examArrange")
    public List<ExamArrangementDto> getExamArrange(){
        return allService.getExamArrange();
    }
}
